3.2 \(\int (a+b \cot ^2(c+d x)) \, dx\)

Optimal. Leaf size=20 \[ a x-\frac{b \cot (c+d x)}{d}-b x \]

[Out]

a*x - b*x - (b*Cot[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0125953, antiderivative size = 20, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3473, 8} \[ a x-\frac{b \cot (c+d x)}{d}-b x \]

Antiderivative was successfully verified.

[In]

Int[a + b*Cot[c + d*x]^2,x]

[Out]

a*x - b*x - (b*Cot[c + d*x])/d

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \left (a+b \cot ^2(c+d x)\right ) \, dx &=a x+b \int \cot ^2(c+d x) \, dx\\ &=a x-\frac{b \cot (c+d x)}{d}-b \int 1 \, dx\\ &=a x-b x-\frac{b \cot (c+d x)}{d}\\ \end{align*}

Mathematica [C]  time = 0.0224386, size = 34, normalized size = 1.7 \[ a x-\frac{b \cot (c+d x) \text{Hypergeometric2F1}\left (-\frac{1}{2},1,\frac{1}{2},-\tan ^2(c+d x)\right )}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[a + b*Cot[c + d*x]^2,x]

[Out]

a*x - (b*Cot[c + d*x]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[c + d*x]^2])/d

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 31, normalized size = 1.6 \begin{align*} ax+{\frac{b}{d} \left ( -\cot \left ( dx+c \right ) +{\frac{\pi }{2}}-{\rm arccot} \left (\cot \left ( dx+c \right ) \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a+b*cot(d*x+c)^2,x)

[Out]

a*x+b/d*(-cot(d*x+c)+1/2*Pi-arccot(cot(d*x+c)))

________________________________________________________________________________________

Maxima [A]  time = 1.46544, size = 31, normalized size = 1.55 \begin{align*} a x - \frac{{\left (d x + c + \frac{1}{\tan \left (d x + c\right )}\right )} b}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*cot(d*x+c)^2,x, algorithm="maxima")

[Out]

a*x - (d*x + c + 1/tan(d*x + c))*b/d

________________________________________________________________________________________

Fricas [B]  time = 2.12406, size = 105, normalized size = 5.25 \begin{align*} \frac{{\left (a - b\right )} d x \sin \left (2 \, d x + 2 \, c\right ) - b \cos \left (2 \, d x + 2 \, c\right ) - b}{d \sin \left (2 \, d x + 2 \, c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*cot(d*x+c)^2,x, algorithm="fricas")

[Out]

((a - b)*d*x*sin(2*d*x + 2*c) - b*cos(2*d*x + 2*c) - b)/(d*sin(2*d*x + 2*c))

________________________________________________________________________________________

Sympy [A]  time = 0.14367, size = 22, normalized size = 1.1 \begin{align*} a x + b \left (\begin{cases} - x - \frac{\cot{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \cot ^{2}{\left (c \right )} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*cot(d*x+c)**2,x)

[Out]

a*x + b*Piecewise((-x - cot(c + d*x)/d, Ne(d, 0)), (x*cot(c)**2, True))

________________________________________________________________________________________

Giac [A]  time = 1.21556, size = 54, normalized size = 2.7 \begin{align*} a x - \frac{{\left (2 \, d x + 2 \, c + \frac{1}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )} - \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )} b}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*cot(d*x+c)^2,x, algorithm="giac")

[Out]

a*x - 1/2*(2*d*x + 2*c + 1/tan(1/2*d*x + 1/2*c) - tan(1/2*d*x + 1/2*c))*b/d